package cn.gok.day1;

import java.util.Arrays;
import java.util.Comparator;

/**
 * @ClassName 数组
 * @Description TODO
 * @Author HP
 * @Date 15:21 2022/7/4
 * @Version 1.0
 **/
class A{

}
public class 数组 {

    public static void main(String[] args) {
//        数组初始化();
        数组工具类();
    }

    private static void 数组工具类() {
        int a[]={4,8,2,1};
        Arrays.sort(a);
        for(int i:a){
            System.out.println(i+"\t");
        }
        System.out.println();
        int index=Arrays.binarySearch(a,4);
        System.out.println(index);
        int a1[]={4,8,2,1};
    }
    private static void 数组初始化() {
        int arr[]=new int [4];
        for (int i = 0; i <arr.length ; i++) {
            arr[i]=i;
        }
        A a[]=new A[4];
        a[0]=new A();
        a[1]=new A();
        a[2]=new A();
        a[3]=new A();
        A a1[]={new A(),new A(),new A(),new A()};
    }

}
